package com.kongwg.java;
//static关键字的应用
public class CricleTest {
	
	public static void main(String[] args) {
		
		
		Circle c1 = new Circle();
		
		Circle c2 = new Circle();
		
		Circle c3 = new Circle(2);
		
		System.out.println("c1的id："+c1.getId());
		System.out.println("c2的id："+c2.getId());
		System.out.println("c3的id："+c3.getId());
		System.out.println("生成圆的个数为："+Circle.getTotal());
	}
}


class Circle{
	private double radius;
	private int id ;
	
	public Circle(){
		id = init++;
		total++;
	}
	
	
	public Circle(double radius) {
		this();
		this.radius = radius;
	}


	private static int init=1001;
	private static int total=0;

	public double getRadius() {
		return radius;
	}
	public void setRadius(double radius) {
		this.radius = radius;
	}
	public int getId() {
		return id;
	}
	public static int getTotal() {
		return total;
	}
	
	
	
	
}